#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>

#include <telebot.h>
#include <logging/logging.h>

#define buffer_length 1024

void
read_token (char buffer[buffer_length])
{
  FILE *fp = fopen (".token", "r");
  if (fp == NULL)
    {
      fprintf (stderr, "failed to open token file.\n");
      exit (1);
    }

  if (fscanf (fp, "%s", buffer) == 0)
    {
      fprintf (stderr, "reading token failed.\n");
      fclose (fp);
      exit (1);
    }

  fclose (fp);
}

int
main (void)
{
//  zlog_info (zc, "token");

  char buffer[buffer_length];
  read_token (buffer);

  return EXIT_SUCCESS;
}
